﻿using Prism.Ioc;
using Prism.Modularity;
using Prism.Regions;
using SanmaoSystem.ViewModels;
using SanmaoSystem.Views;
using System.Windows;
using System.Windows.Navigation;

namespace SanmaoSystem
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App
    {
        protected override Window CreateShell()
        {
            return Container.Resolve<MainWindow>();
        }
        protected override void InitializeShell(Window shell)
        {
            if(Container.Resolve<LoginWindow>().ShowDialog()==false ){
                Application.Current.Shutdown();
            }
            else base.InitializeShell(shell);
        }
        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterForNavigation<Charts>();
            containerRegistry.RegisterForNavigation<Cargo>();
            containerRegistry.RegisterForNavigation<CargoType>();
            containerRegistry.RegisterForNavigation<Members>();
            containerRegistry.RegisterForNavigation<Record>();
            containerRegistry.RegisterForNavigation<Null>();
  
            containerRegistry.RegisterSingleton<CargoTypeViewModel>();
        }
      

    }
}
